package com.py.credit.utils;

import com.py.credit.entity.LhjcCube;

import java.util.Date;

public enum NewBatchIdUtil {

    INSTANCE;

    public static NewBatchIdUtil getInstance() {
        return INSTANCE;
    }

    public String buildNewBatchId(String orgBm, LhjcCube cube) {
        // 随机4位数字
        StringBuilder batchId = new StringBuilder();
        batchId.append("EX-");

        batchId.append("1000");

        batchId.append("-");
        batchId.append(orgBm);
        batchId.append("-");
        batchId.append(DateUtil.getInstance().dateToStr(new Date(), DateUtil.YYYYMMDD));
        batchId.append("-");
        batchId.append((int) (Math.random() * 9000 + 1000));

        return batchId.toString();
    }
}
